Skip to content

fix(UpdatePanel): add zip type to semver-based update checks - #2444

Merged
meteyou merged 3 commits into
mainsail-crew:developfrom
prestonbrown:fix/zip-type-update-button
Jun 16, 2026
Merged

fix(UpdatePanel): add zip type to semver-based update checks#2444
meteyou merged 3 commits into
mainsail-crew:developfrom
prestonbrown:fix/zip-type-update-button

Conversation

@prestonbrown

Copy link
Copy Markdown
Contributor

Summary

Moonraker's type: zip deployments use semver versioning (via release_info.json) just like web and python types. However, the Update Manager panel only checks semver for web and python types, causing zip type entries to fall through to the git_repo code path which checks commitsBehind -- always empty for zip deployments.

This results in zip-type applications perpetually showing UP-TO-DATE even when a newer version is available on GitHub, with the update button permanently disabled.

Root Cause

In Entry.vue, five computed properties gate on ['python', 'web'].includes(this.type) for semver-based update detection. The zip type is not included, so it falls through to commitsBehind.length === 0 which is always true for non-git deployments.

Fix

Add zip to all five type-check arrays in Entry.vue:

  • btnDisabled -- enables update button when semver detects newer version
  • btnIcon -- shows upload icon instead of checkmark
  • btnColor -- shows primary color instead of green
  • btnText -- shows Update instead of Up-to-date
  • Template version link -- makes version clickable to release page

@coderabbitai

coderabbitai Bot commented Feb 19, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 690d7205-da74-4ad1-9740-7f24e27fb18f

📥 Commits

Reviewing files that changed from the base of the PR and between 813f1b4 and a3f801f.

📒 Files selected for processing (1)
  • src/components/panels/Machine/UpdatePanel/Entry.vue
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/panels/Machine/UpdatePanel/Entry.vue

📝 Walkthrough

Walkthrough

Updated a single Vue component to introduce isSemverType() getter and treat zip as a semver-bearing type alongside executable, python, and web. The new getter is applied across the release-link template condition and multiple button state/appearance getters, replacing explicit type arrays.

Changes

Semver Type Abstraction

Layer / File(s) Summary
isSemverType getter and template condition
src/components/panels/Machine/UpdatePanel/Entry.vue
A new isSemverType getter classifies update types as semver-bearing by checking this.type against executable, python, web, and zip. The release-link template condition is updated to use this getter so zip renders the same update/release-link path as existing semver types.
Button logic refactoring
src/components/panels/Machine/UpdatePanel/Entry.vue
Getters for button state and appearance (btnDisabled, btnIcon, btnColor, btnText) are refactored to use isSemverType instead of hardcoded type lists. Semver types now disable the button when semverUpdatable is false, update the icon based on semverUpdatable, apply primary color when updates are available, and show semver-specific Update/Unknown text labels.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • mainsail-crew/mainsail#2463: Both PRs modify src/components/panels/Machine/UpdatePanel/Entry.vue to expand semver-driven UI behavior by adding new update types to the semver abstraction.

Poem

🐰 I nibble code where types align,
zip joins web in semver line,
Getters tuned and templates sing,
A tiny hop, a useful thing,
Happy builds and carrot wine!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: add zip type to semver-based update checks' accurately and specifically describes the main change: adding zip type support to semver-based update detection logic.
Description check ✅ Passed The description clearly relates to the changeset by explaining the problem (zip types not treated as semver-based), root cause, and the specific fix applied across five computed properties in Entry.vue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/components/panels/Machine/UpdatePanel/Entry.vue (1)

274-274: Optional: extract the repeated semver-type guard into a computed property.

['python', 'web', 'zip'] is now spelled out four times in the script section. If a new semver-based type (e.g. pip) is added later, it's easy to update three of the four occurrences and silently miss one, causing a UI regression identical to the one this PR is fixing.

Extracting to a single computed getter eliminates that risk:

♻️ Proposed refactor — add `isSemverType` getter
+    get isSemverType() {
+        return ['python', 'web', 'zip'].includes(this.type)
+    }
+
     get btnDisabled() {
         if (['printing', 'paused'].includes(this.printer_state)) return true
         if (!this.isValid || this.isCorrupt || this.isDirty || this.commitsBehind.length) return false
 
-        if (['python', 'web', 'zip'].includes(this.type)) return !this.semverUpdatable
+        if (this.isSemverType) return !this.semverUpdatable
 
         return this.commitsBehind.length === 0
     }
 
     get btnIcon() {
         if (this.isDetached || !this.isValid || this.isCorrupt || this.isDirty) return mdiCloseCircle
 
-        if (['python', 'web', 'zip'].includes(this.type)) {
+        if (this.isSemverType) {
             if (this.semverUpdatable) return mdiProgressUpload
             else if (this.localVersion === null || this.remoteVersion === null) return mdiHelpCircleOutline
         }
         ...
     }
 
     get btnColor() {
         if (this.isCorrupt || this.isDetached || this.isDirty || !this.isValid) return 'orange'
 
-        if (['python', 'web', 'zip'].includes(this.type) && this.semverUpdatable) return 'primary'
+        if (this.isSemverType && this.semverUpdatable) return 'primary'
         ...
     }
 
     get btnText() {
         ...
-        if (['python', 'web', 'zip'].includes(this.type)) {
+        if (this.isSemverType) {
             if (this.semverUpdatable) return this.$t('Machine.UpdatePanel.Update')
             ...
         }
         ...
     }

The same guard can be applied in the template too:

-<template v-else-if="['web', 'zip'].includes(type) && semverUpdatable">
+<template v-else-if="isSemverType && type !== 'python' && semverUpdatable">

(Or keep the template inline — the template form is less critical since it's a single occurrence.)

Also applies to: 282-285, 295-295, 307-311

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/panels/Machine/UpdatePanel/Entry.vue` at line 274, The
repeated semver-type check (['python','web','zip']) is duplicated across the
Entry.vue script; add a computed getter named isSemverType that returns
['python','web','zip'].includes(this.type) and replace all inline checks
(currently used in the conditions around the semverUpdatable logic—e.g., the if
(['python','web','zip'].includes(this.type) ... usages) with this.isSemverType
so future types need updating in only one place; ensure the new getter is
exported in the component's computed block and update the template/other script
references to use isSemverType.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/components/panels/Machine/UpdatePanel/Entry.vue`:
- Line 274: The repeated semver-type check (['python','web','zip']) is
duplicated across the Entry.vue script; add a computed getter named isSemverType
that returns ['python','web','zip'].includes(this.type) and replace all inline
checks (currently used in the conditions around the semverUpdatable logic—e.g.,
the if (['python','web','zip'].includes(this.type) ... usages) with
this.isSemverType so future types need updating in only one place; ensure the
new getter is exported in the component's computed block and update the
template/other script references to use isSemverType.

prestonbrown added a commit to prestonbrown/helixscreen that referenced this pull request Feb 19, 2026
DIEHARDave added a commit to DIEHARDave/z_ad5x that referenced this pull request Apr 2, 2026
# HelixScreen Update Manager
# Added by HelixScreen installer - enables one-click updates from Mainsail/Fluidd
# NOTE: type: web is used instead of type: zip as a workaround for
# mainsail-crew/mainsail#2444 (zip type always shows UP-TO-DATE).
# A systemd path unit handles service restart after Moonraker extracts the update.
Moonraker's type: zip deployments use semver versioning (via
release_info.json) just like web and python types. However, the
Update Manager panel only checked semver for web and python types,
causing zip type entries to fall through to the git_repo code path
which checks commitsBehind — always empty for zip deployments.

This resulted in zip-type applications perpetually showing UP-TO-DATE
even when a newer version was available on GitHub, with the update
button permanently disabled.

Add zip to all five type-check arrays in Entry.vue so that zip
deployments correctly use semver comparison for update detection.
@meteyou
meteyou force-pushed the fix/zip-type-update-button branch from bf51a92 to 813f1b4 Compare June 16, 2026 11:47
@meteyou meteyou changed the title fix: add zip type to semver-based update checks fix(UpdatePanel): add zip type to semver-based update checks Jun 16, 2026
@meteyou
meteyou merged commit cbabdb4 into mainsail-crew:develop Jun 16, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants